package com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.repository;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.feign.service.UserFeignService;
import com.alibaba.algo.cooperation.feign.vo.req.SelectUserInfoReqVO;
import com.alibaba.algo.cooperation.feign.vo.res.RpcUserInfoVO;
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.FlowTitleExpression;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.repository.FlowTitleExpressionRepository;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.mapper.FlowTitleExpressionDAO;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.mapper.FormProcessInstanceHandleRelDAO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author: lzb
 * @date: 2021/11/9 17:04
 */
@Slf4j
@Service
public class FlowTitleExpressionRepositoryImpl implements FlowTitleExpressionRepository {

    @Autowired
    private FlowTitleExpressionDAO flowTitleExpressionDAO;


    /**
     * 批量添加自定义标题表达式
     *
     * @param flowTitleExpressionList
     * @return
     */
    @Override
    public void batchInsert(List<FlowTitleExpression> flowTitleExpressionList) {
        if (!CollectionUtils.isEmpty(flowTitleExpressionList)) {
            flowTitleExpressionDAO.batchInsert(flowTitleExpressionList);
        }
    }

    @Override
    public void insertFlowTitleExpression(FlowTitleExpression flowTitleExpression) {
        flowTitleExpressionDAO.insertFlowTitleExpression(flowTitleExpression);
    }


    @Override
    public List<FlowTitleExpression> getCustomTitleExpressionByDeployId(String deployId) {
        return flowTitleExpressionDAO.getFlowTitleExpressionList(deployId);
    }


}
